home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / mlpmodul.sit / MacLogimoPlus Documentation / DEF3 Files / WindowMgr.DEF < prev   
Encoding:
Modula Definition  |  1990-06-14  |  7.2 KB  |  133 lines  |  [TEXT/PMED]

  1. DEFINITION MODULE WindowMgr;   (* Christoph Fleischer 24.01.85 *)
  2.                                (* MacIntosh Toolbox Window Manager Routines *)
  3.                                (* last modification   26.06.85 fxk *)
  4. FROM SYSTEM IMPORT ADDRESS,ADR;
  5. FROM MacBase IMPORT LongInt,Handle,StrPtr;
  6. FROM EventMgr IMPORT EventRecord;
  7. FROM QuickDraw IMPORT GrafPtr,GrafPort,RgnHandle,Point,Rect;
  8.  
  9. EXPORT QUALIFIED
  10.     dialogKind,userKind,DocumentProc,DBoxProc,NoShadowDBox,RDocProc,inDesk,inMenuBar,inSysWindow,inContent,
  11.     inDrag,inGrow,inGoAway,wNoHit,wInContent,wInDrag,wInGrow,wInGoAway,
  12.     WindowPeek,WindowPtr,WindowRecord,WindowMessage,WindowProcPtr,
  13.     InitWindows,GetWMgrPort,NewWindow,GetNewWindow,CloseWindow,DisposeWindow,
  14.     SetWTitle,GetWTitle,SelectWindow,HideWindow,ShowWindow,ShowHide,ClipAbove,
  15.     HiliteWindow,BringToFront,SendBehind,FrontWindow,DrawGrowIcon,FindWindow,
  16.     TrackGoAway,MoveWindow,DragWindow,GrowWindow,SizeWindow,PaintOne,PaintBehind,
  17.     SaveOld,DrawNew,CalcVis,CalcVisBehind,CheckUpdate,BeginUpdate,EndUpdate,
  18.     SetWRefCon,GetWRefCon,SetWindowPic,GetWindowPic,ValidRect,ValidRgn,InvalRect,
  19.     InvalRgn,PinRect,DragGrayRgn,GetWPeek;
  20.  
  21. CONST
  22.   dialogKind   = 2; userKind     = 8;          (* types of windows *)
  23.  
  24.   DocumentProc = 0;          (* window definition procedure IDs *)
  25.   DBoxProc     = 1;  NoShadowDBox = 2;  RDocProc     = 16;
  26.  
  27.   inDesk       = 0;          (* FindWindow Result Codes *)
  28.   inMenuBar    = 1;  inSysWindow  = 2;  inContent    = 3;
  29.   inDrag       = 4;  inGrow       = 5;  inGoAway     = 6;
  30.  
  31.   wNoHit       = 0;          (* defProc hit test codes *)
  32.   wInContent   = 1;  wInDrag      = 2;  wInGrow      = 3;  wInGoAway    = 4;
  33.  
  34. TYPE
  35.   StringHandle = POINTER TO StrPtr;
  36.   Ptr          = ADDRESS;
  37.   PicHandle    = ADDRESS;
  38.   WindowPtr    = GrafPtr;
  39.   WindowPeek   = POINTER TO WindowRecord;
  40.   WindowRecord = RECORD
  41.                    port:          GrafPort;
  42.                    windowKind:    INTEGER;
  43.                    visible:       BOOLEAN;
  44.                    hilited:       BOOLEAN;
  45.                    goAwayFlag:    BOOLEAN;
  46.                    spareFlag:     BOOLEAN;
  47.                    strucRgn:      RgnHandle;
  48.                    contRgn:       RgnHandle;
  49.                    updateRgn:     RgnHandle;
  50.                    windowDefProc: Handle;
  51.                    dataHandle:    Handle;
  52.                    titleHandle:   StringHandle;
  53.                    titleWidth:    INTEGER;
  54.                    ControlList:   Handle;
  55.                    nextWindow:    WindowPeek;
  56.                    windowPic:     ADDRESS; (*PicHandle;*)
  57.                    refCon:        LongInt;
  58.                  END;
  59.  
  60.   WindowMessage = (wDraw, wHit, wCalcRgns, wNew, wDispose, wGrow, wDrawGIcon);
  61.   WindowProcPtr = PROC;
  62.  
  63. PROCEDURE ClipAbove(window: WindowPeek);                      (*INLINE $A90B*)
  64. PROCEDURE PaintOne(window: WindowPeek; clobbered: RgnHandle); (*INLINE $A90C*)
  65. PROCEDURE PaintBehind(startWindow: WindowPeek; clobbered: RgnHandle);
  66.                                                               (*INLINE $A90D*)
  67. PROCEDURE SaveOld(window: WindowPeek);                        (*INLINE $A90E*)
  68. PROCEDURE DrawNew(window: WindowPeek; fUpdate: BOOLEAN);      (*INLINE $A90F*)
  69. PROCEDURE CalcVis(window: WindowPeek);                        (*INLINE $A909*)
  70. PROCEDURE CalcVisBehind(startWindow: WindowPeek; clobbered: RgnHandle);
  71.                                                               (*INLINE $A90A*)
  72. PROCEDURE ShowHide(window: WindowPtr; showFlag: BOOLEAN);     (*INLINE $A908*)
  73.  
  74. PROCEDURE CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;    (*INLINE $A911*)
  75. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);                    (*INLINE $A910*)
  76.  
  77. PROCEDURE InitWindows;                                        (*INLINE $A912*)
  78. PROCEDURE NewWindow(wStorage:       Ptr;
  79.                     VAR boundsRect: Rect;
  80.                     title:          StrPtr;
  81.                     visible:        BOOLEAN;
  82.                     theProc:        INTEGER;
  83.                     behind:         WindowPtr;
  84.                     goAwayFlag:     BOOLEAN;
  85.                     refCon:         LongInt): WindowPtr;      (*INLINE $A913*)
  86.  
  87. PROCEDURE DisposeWindow (theWindow: WindowPtr);               (*INLINE $A914*)
  88. PROCEDURE CloseWindow   (theWindow: WindowPtr);               (*INLINE $A92D*)
  89. PROCEDURE MoveWindow    (theWindow: WindowPtr; h,v: INTEGER; BringToFront:BOOLEAN);
  90.                                                               (*INLINE $A91B*)
  91. PROCEDURE SizeWindow    (theWindow: WindowPtr; width,height: INTEGER; fUpdate: BOOLEAN);
  92.                                                               (*INLINE $A91D*)
  93. PROCEDURE GrowWindow    (theWindow: WindowPtr; startPt:Point;
  94.                          VAR bBox: Rect): LongInt;            (*INLINE $A92B*)
  95. PROCEDURE DragWindow    (theWindow: WindowPtr; startPt:Point;
  96.                          VAR boundsRect: Rect);               (*INLINE $A925*)
  97. PROCEDURE ShowWindow    (theWindow: WindowPtr);               (*INLINE $A915*)
  98. PROCEDURE HideWindow    (theWindow: WindowPtr);               (*INLINE $A916*)
  99. PROCEDURE SetWTitle     (theWindow: WindowPtr;title: StrPtr);(*INLINE $A91A*)
  100. PROCEDURE GetWTitle     (theWindow: WindowPtr;title: StrPtr);(*INLINE $A919*)
  101. PROCEDURE HiliteWindow  (theWindow: WindowPtr; fHiLite: BOOLEAN);(*INLINE $A91C*)
  102. PROCEDURE BeginUpdate   (theWindow: WindowPtr);               (*INLINE $A922*)
  103. PROCEDURE EndUpdate     (theWindow: WindowPtr);               (*INLINE $A923*)
  104. PROCEDURE SetWRefCon    (theWindow: WindowPtr; data: LongInt);(*INLINE $A918*)
  105. PROCEDURE GetWRefCon    (theWindow: WindowPtr): LongInt;      (*INLINE $A917*)
  106. PROCEDURE SetWindowPic  (theWindow: WindowPtr; thePic: PicHandle);(*INLINE $A92E*)
  107. PROCEDURE GetWindowPic  (theWindow: WindowPtr): PicHandle;    (*INLINE $A92F*)
  108. PROCEDURE BringToFront  (theWindow: WindowPtr);               (*INLINE $A920*)
  109. PROCEDURE SendBehind    (theWindow,behind: WindowPtr);        (*INLINE $A921*)
  110. PROCEDURE FrontWindow(): WindowPtr;                         (*INLINE $A924*)
  111. PROCEDURE SelectWindow  (theWindow: WindowPtr);               (*INLINE $A91F*)
  112. PROCEDURE TrackGoAway   (theWindow: WindowPtr; thePoint:Point): BOOLEAN;
  113.                                                               (*INLINE $A91E*)
  114. PROCEDURE DrawGrowIcon  (theWindow: WindowPtr);               (*INLINE $A904*)
  115.  
  116. PROCEDURE ValidRect     (VAR goodRect: Rect);                 (*INLINE $A92A*)
  117. PROCEDURE ValidRgn      (goodRgn: RgnHandle);                 (*INLINE $A929*)
  118. PROCEDURE InvalRect     (VAR badRect: Rect);                  (*INLINE $A928*)
  119. PROCEDURE InvalRgn      (badRgn:  RgnHandle);                 (*INLINE $A927*)
  120. PROCEDURE FindWindow    (thePoint:Point;
  121.                          VAR  theWindow: WindowPtr): INTEGER; (*INLINE $A92C*)
  122. PROCEDURE GetNewWindow  (windowID: INTEGER; wStorage: Ptr;
  123.                          behind: WindowPtr): WindowPtr;       (*INLINE $A9BD*)
  124. PROCEDURE PinRect(VAR theRect: Rect; thePoint:Point): LongInt;  (*INLINE $A94E*)
  125. PROCEDURE DragGrayRgn(theRgn: RgnHandle; startPt:Point; VAR boundsRect,
  126.                       slopRect: Rect;axis: INTEGER;
  127.                       actionProc: WindowProcPtr): LongInt;    (*INLINE $A905*)
  128.  
  129. (* This procedure finds the correspondent WindowPeek to a given WindowPtr *)
  130. PROCEDURE GetWPeek(VAR wPointer: WindowPtr): WindowPeek;
  131.  
  132. END WindowMgr.
  133.